<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
    <title>统计单击次数</title>
    <script src="JS/react.js"></script>
    <script src="JS/react-dom.js"></script>
	<script src="JS/browser.min.js"></script>
  </head>
  <body>
    <div id="example"></div>  
    <script type="text/babel">
		var ClickNum = React.createClass({
			getInitialState:function(){
				return {
					clickCount: 0,
				}
			},
			handleClick: function(){
				this.setState({
					clickCount: this.state.clickCount + 1,
				})
			},
			render: function(){
				return (
					<div>
						<h2>单击下面按钮</h2>
						<button onClick={this.handleClick}>单击按钮统计单击次数</button>
						<p>单击次数：{this.state.clickCount}</p>
					</div>
				)
			}
		});
		ReactDOM.render(
			<ClickNum />,
			document.getElementById('example')
		)
    </script>
  </body>
</html>